package com.dk.service.impl;

import com.dk.mapper.ArtTypeMapper;
import com.dk.pojo.ArtType;
import com.dk.pojo.ArtTypeExample;
import com.dk.service.ArtTypeServiceI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArtTypeServiceImpl implements ArtTypeServiceI {

    @Autowired
    private ArtTypeMapper artTypeMapper;

    @Override
    public List<ArtType> getInfoServer() {
        return artTypeMapper.selectByExample(new ArtTypeExample());
    }

    @Override
    public void saveById(ArtType artType) {
        artTypeMapper.insertSelective(artType);
    }

    @Override
    public ArtType getUpdateById(Integer typeId) {
        return artTypeMapper.selectByPrimaryKey(typeId);
    }

    @Override
    public void updateById(ArtType artType) {
        artTypeMapper.updateByPrimaryKeySelective(artType);
    }

    @Override
    public void deleteById(Integer typeId) {
        artTypeMapper.deleteByPrimaryKey(typeId);
    }
}
